#-.-coding:utf-8 -.-

#对浏览器的操作

# from selenium import webdriver
# driver = webdriver.Ie()
# driver.get("http://www.baidu.com")
# driver.find_element_by_id("kw").send_keys("selenium")
# driver.find_element_by_id("su").click()


#打印title
# from selenium import webdriver
# import time
# driver = webdriver.Ie()
# driver.get("http://www.baidu.com")
# print driver.title
# time.sleep(5)
# driver.quit()


#打印url
# from selenium import webdriver
# import time
# driver = webdriver.Ie()
# url = 'http://www.baidu.com'
# print"now access %s"%(url)
# driver.get(url)
# time.sleep(3)
#
# driver.find_element_by_id("kw").send_keys("selenium")
# driver.find_element_by_id("su").click()
# time.sleep(3)
# driver.quit()


#浏览器最大化
# from selenium import webdriver
# import time
# driver = webdriver.Ie()
# driver.maximize_window()
# driver.get("http://www.baidu.com")
# time.sleep(3)
# driver.find_element_by_id("kw").send_keys("selenium")
# driver.find_element_by_id("su").click()
# time.sleep(3)
# driver.quit()


#设置浏览器宽、高
# from selenium import webdriver
# import time
# driver = webdriver.Chrome()
# driver.get("http://m.mail.10086.cn")
# print "设置浏览器宽280、高400显示"
# driver.set_window_size(280,400)
# time.sleep(3)
# driver.quit()


# #操作浏览器的前进、后退
# from selenium import webdriver
# import time
# driver = webdriver.Chrome()
#
# #访问百度首页
# first_url = 'http://www.baidu.com'
# print "now access %s"%(first_url)
# driver.get(first_url)
# time.sleep(3)
#
# #访问新闻页面
# second_url = 'http://news.baidu.com'
# print"now access %s"%(second_url)
# driver.get(second_url)
# time.sleep(3)
#
# #返回到百度首页
# print "back to %s"%(first_url)
# driver.back()
# time.sleep(2)
#
# #前进到新闻页面
# print "foward to %s"%(second_url)
# driver.forward()
# time.sleep(2)
#
# driver.quit()



#test获取元素文本

# from selenium import webdriver
# import time
# driver = webdriver.Ie()
# driver.get("http://www.baidu.com")
# #id = cp元素的文本信息
# data = driver.find_element_by_id("cp").text
# print data
# driver.quit()




